#ifndef TEST_SCENE_H
#define TEST_SCENE_H

#include "Scene.h"
#include "Entity3D.h"
#include <stdio.h>
#include "Camera.h"
#include <cmath>

#include <Cg/cg.h>
#include <Cg/cgD3D9.h>

#pragma comment( lib, "cg.lib" )
#pragma comment( lib, "cgD3D9.lib" )

extern CUSTOMVERTEX OurVertices[24];
extern short indices[36];
extern CGparameter lightPos;
extern CGparameter cameraPos;
extern LPDIRECT3DTEXTURE9 pRenderTexture;

extern CGprogram program;
extern CGprogram programFragment;


class TestScene : public Scene
{
private:
	

	LPD3DXBUFFER materialBuffer;
	LPD3DXMESH mesh;
	DWORD numMaterials;
	
	LPDIRECT3DVERTEXBUFFER9 v_buffer; //vertex buffer
	LPDIRECT3DINDEXBUFFER9 i_buffer;

	LPDIRECT3DVERTEXBUFFER9 vps_buffer;

	D3DXMATERIAL * d3dxTankMaterials;
	D3DMATERIAL9 * meshTankMaterials;
	LPDIRECT3DTEXTURE9 * meshTankTextures;
	
	Entity3D tank;
	float rotationCamera;
	
	Camera * camera;

	int cantX;
	int cantY;
	D3DXVECTOR3 lightPosition;

public:
	TestScene(LPDIRECT3DDEVICE9 _d3ddev);
	void LoadContent(LPDIRECT3DDEVICE9 _d3ddev);
	void Draw(LPDIRECT3DDEVICE9 _d3ddev);
	void Update(DWORD dt);
	void HandleInput(InputManager * _input);
	void Init();
	~TestScene();
};

#endif